import { ApprovaltimeSave } from '../services/API';
import { message } from 'antd';

export default {
  namespace: 'ApprovalTime',
  state: {},
  effects: {
    // 登录
    *ApprovaltimeSave({ payload }, { call }) {
      const res = yield call(ApprovaltimeSave, payload);
      if (res.code === 200) {
        message.success('Operation succeeded');
      } else {
        message.error('Operation failed');
      }
    }
  },

  reducers: {
    save(state, action) {
      return { ...state, ...action.payload };
    }
  }
};
